package com.sita.bike.utils;

import java.security.MessageDigest;

/**
 * Class com.sita.bike.utils is for
 *
 * @author xiaodong on 15/3/1.
 */
public class CheckSumUtils {
    public static String sha256(String str) {
        MessageDigest digest = null;
        String hash = null;
        try {
            digest = MessageDigest.getInstance("SHA-256");
            digest.update(str.getBytes("UTF-8"));
            hash = HexUtils.bytesToHexString(digest.digest());
        } catch (Exception e) {
        }
        return hash;
    }
}
